package de.szut.bomberman.main;


import de.szut.bomberman.gui.main.GUIController;
import de.szut.bomberman.gui.options.OptionKeys;
import de.szut.gui.options.Options;

/**
 * Controls the entire program
 * @author dqi12huisinga
 *
 */
public class Controller {
	private static Controller instance;
	
	/**
	 * Singleton access for the controller
	 * @return Instance of the controller
	 */
	public static Controller getInstance() {
		if (instance == null) {
			instance = new Controller();
			instance.startController();
		}
		return instance;
	}

	private GUIController guiController;
	private Options options;
	
	
	public GUIController getGuiController() {
		return guiController;
	}

	public void setGuiController(GUIController guiController) {
		this.guiController = guiController;
	}
	
	
	public Options getOptions() {
		return options;
	}

	public void setOptions(Options options) {
		this.options = options;
	}

	/**
	 * Main of the program
	 * @param args: cmd arguments
	 */
	public static void main(String[] args) {
		getInstance();
	}
	
	private Controller(){}
	
	private void startController() {
		// TODO: Do starting stuff
		options = new Options();
		options.loadOptionsFromKeys(OptionKeys.ALLKEYS);
		guiController = new GUIController();
		guiController.startGUIController();
	}
}
